UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'khSc8+siUrxIcPi8iAHZAgd8mZiUHjQ42BKTZpXLtbQ='
WHERE
key_id = '1c28a4a2d1cde07e03a6d0e1f6734895c13d3a652abf63f9354c02adb5b9b4a6'
AND (
token = 'khSc8+siUrxIcPi8iAHZAgd8mZiUHjQ42BKTZpXLtbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)