UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rT4pJc7hT1oRYyzIgZP2HN1vAyf+zgzk8N8o8fCeAzE='
WHERE
key_id = '9a10bba1fae02657d2fbbe1b9748b980da92f7c64a29d9d6cc3333fd4729e788'
AND (
token = 'rT4pJc7hT1oRYyzIgZP2HN1vAyf+zgzk8N8o8fCeAzE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)