UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F2lmrEv4gGOOiiva3ptWvynPEZrX8OWQ4xm9hBSVyz8='
WHERE
key_id = 'acfcc9610eebc2c7319cad53d6979fc9112e8d3eff0be956299c2b4f1ea7bedd'
AND (
token = 'F2lmrEv4gGOOiiva3ptWvynPEZrX8OWQ4xm9hBSVyz8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)