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