UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XLESa7lRPJ7l3M/XxxYHzZkPOqSilOEO5/+L0apszsA='
WHERE
key_id = 'ca13a2611146ef7c6bf7828cef0d8bbb4bfe8f84431d511b87a8ba6eda51923a'
AND (
token = 'XLESa7lRPJ7l3M/XxxYHzZkPOqSilOEO5/+L0apszsA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)