UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GxC6UOI2ELsSpxAFoXjPHoev+RtP3nEv+dQ+00wgHUI='
WHERE
key_id = 'e8ae70f25621ac6dd03fd37cd7763cab5dc872f5d5ff0514db6882bc7668a5b5'
AND (
token = 'GxC6UOI2ELsSpxAFoXjPHoev+RtP3nEv+dQ+00wgHUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)