UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zUtLpPk1nGSfzDYmM/T5Kn9/TLSHQxvEWTJ1jPI/Tqc='
WHERE
key_id = 'cd31fc20f1c73ab8e86f942bbba1d04b122c5e3dc4a7ecf0804bd6d5450942fc'
AND (
token = 'zUtLpPk1nGSfzDYmM/T5Kn9/TLSHQxvEWTJ1jPI/Tqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)