UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jo4LwlB7kjWBYBD4SyTXRUxntMRBR9/DnygTyN8t2oo='
WHERE
key_id = '522111b164636e0949f9e1d229eff6cb98f2bfaf8bb86e6b723056b74b203c6d'
AND (
token = 'Jo4LwlB7kjWBYBD4SyTXRUxntMRBR9/DnygTyN8t2oo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)