UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yTa2HiD3NM5Iwje3LYjGorQR673s0t10TyUu6LuwAo0='
WHERE
key_id = '95c09ff2f5b5bc29a80cb7e05b03de54f995e4d747800cb09d6ca4a39e2a0487'
AND (
token = 'yTa2HiD3NM5Iwje3LYjGorQR673s0t10TyUu6LuwAo0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)