UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VDGswFRwV/ku9yMZFer87k/9j9ZZM/XfVqn04O/qrgU='
WHERE
key_id = '0c1cb1c9ca52fc5d67f944cf206a83135acdea57d2c31c4d22836b5cb7490b9c'
AND (
token = 'VDGswFRwV/ku9yMZFer87k/9j9ZZM/XfVqn04O/qrgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)