UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pmuLKiFa5DEj9JfIDJ50o0GaJJA84dku4lfZVTQXRuo='
WHERE
key_id = 'cecc2e5bb29b5c5ff16a3af2f5c2474703722bfd3ab4a287485e9c210a414489'
AND (
token = 'pmuLKiFa5DEj9JfIDJ50o0GaJJA84dku4lfZVTQXRuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)