UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DuySZOt9sgoXJj12s2Dp/G16WJunvbTG2bcAL8tncao='
WHERE
key_id = 'ed83579916922279469a2e303c316fb411f71b23cd083cdd3ac5ab488fb407d7'
AND (
token = 'DuySZOt9sgoXJj12s2Dp/G16WJunvbTG2bcAL8tncao='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)