UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o076V0QBof+fGC2NzlfH9M6Z57vqhbgXdp2L/bvMwqA='
WHERE
key_id = '6ea330e98429f9b92e043781a06fe97ef27cf70143c34c15de925a22e1d3dd52'
AND (
token = 'o076V0QBof+fGC2NzlfH9M6Z57vqhbgXdp2L/bvMwqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)