UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZyUUG4rT+2zpvHN1kbO9eZKa3NyFB9hV1+amn5VGjhU='
WHERE
key_id = '0354e0f150d52c53fecee6545d81ece5cf6fe1e8c516c2bc119bd81f8b6d4686'
AND (
token = 'ZyUUG4rT+2zpvHN1kbO9eZKa3NyFB9hV1+amn5VGjhU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)