UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R5RdTFhjv1CWoERypICgqtJOMGdx4Gl1EkLWU27moHo='
WHERE
key_id = '7d6c2b7c42ce17ecb882821b3fd3373537ca747b0ddb69742e9ac35d34e1d72c'
AND (
token = 'R5RdTFhjv1CWoERypICgqtJOMGdx4Gl1EkLWU27moHo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)