UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SDFVy0/jmGNsY4OEc0TxEc5qWkvux7QDcsFma7yqc4A='
WHERE
key_id = '4d1836e949d79087bfb5c151ca4c563d467cd173356783c6865dad27ca021f63'
AND (
token = 'SDFVy0/jmGNsY4OEc0TxEc5qWkvux7QDcsFma7yqc4A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)