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