UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z9J3OttHR/h3qg/QePUDAi+gHzRbOCrKD1Cuzuaa5cc='
WHERE
key_id = '3c5333b33dad118b279a8bfdcd0d9953be424263aece71f79c491901a01337f0'
AND (
token = 'Z9J3OttHR/h3qg/QePUDAi+gHzRbOCrKD1Cuzuaa5cc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)