UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oMZtgjDEjTaebnQA69NAGOslcXItZ+2nJ0MZhLxrLxE='
WHERE
key_id = '7b4cf18abc647d03e4a79a1e9e9e070b4f59bf8d91426e96f01c5b5ad4f8ee9f'
AND (
token = 'oMZtgjDEjTaebnQA69NAGOslcXItZ+2nJ0MZhLxrLxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)