UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xKN53jAL5XyXfmxBVEt6ZESur3KR9xPTQDNGWzCcDcY='
WHERE
key_id = 'c01c0d43b917f35983b3de7cdb4e0ea1ee8999c09e6566fcf24388cdcc620729'
AND (
token = 'xKN53jAL5XyXfmxBVEt6ZESur3KR9xPTQDNGWzCcDcY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)