UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5gFP/cl/G+bM04PwxuhaHmVXSPEkIbgws9CugrB1pI0='
WHERE
key_id = '88fc07c6c3b69600f748e90ef19b509e0a0aa4e57316e6102895b07cc980a28c'
AND (
token = '5gFP/cl/G+bM04PwxuhaHmVXSPEkIbgws9CugrB1pI0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)