UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tlgZpKmxAwMbfC+sh+VkFDrTrfMBxhPLF5D9wjMqRTQ='
WHERE
key_id = 'e6b5efe48e67715ba25d22c01fc727846de43b9ef3f59a09624fd81e6ba7bc81'
AND (
token = 'tlgZpKmxAwMbfC+sh+VkFDrTrfMBxhPLF5D9wjMqRTQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)