UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fs7hotb3azOMhqwkrIa7U6Y44gpqj2vJXGpymi0e/Sk='
WHERE
key_id = '3aa4e680258d9a8691e0ba2ab8753d8e80344bf5500165079982fdea68c16c71'
AND (
token = 'fs7hotb3azOMhqwkrIa7U6Y44gpqj2vJXGpymi0e/Sk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)