UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+u0wkpvJ1o1UwR7ZJdEZvE4ZbCX0y6YIfS0ie3L/L1U='
WHERE
key_id = '8c532f9f2ce63bcd20731d6318a3616d8cf5e94ff5eed65dc97792f6d82f0b2b'
AND (
token = '+u0wkpvJ1o1UwR7ZJdEZvE4ZbCX0y6YIfS0ie3L/L1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)