UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMhCR8Oeb2yCBWdrftiqO67VPD9PJMxC7wAcozTCB1U='
WHERE
key_id = '20950d76faa24a1aa9ebf4669d575b553df0ba44b9a4ea85ccf32372cb024302'
AND (
token = 'jMhCR8Oeb2yCBWdrftiqO67VPD9PJMxC7wAcozTCB1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)