UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZJpQHCMXp/Y5NxPQn3f9QL8o6Kj9e9LSGp9Vh4cMTlA='
WHERE
key_id = '6b718b54bfd3032eb6ad1e5d4051759cc0596415c3ad83328adc8fdb01ea20ee'
AND (
token = 'ZJpQHCMXp/Y5NxPQn3f9QL8o6Kj9e9LSGp9Vh4cMTlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)