UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dQmqZI75DZDkEbJxntVcNY6txK2DQoqz3Poa/ps/dJc='
WHERE
key_id = 'fb6d4664a780816ffaecffc7af5db6d25f09ac8a1f3fa1d22e8762ee32225b54'
AND (
token = 'dQmqZI75DZDkEbJxntVcNY6txK2DQoqz3Poa/ps/dJc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)