UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4alFTQ6R3nzHlll8cBRgUEgICizSDVdCyjLYinghuio='
WHERE
key_id = '2694e6c32ac316c1d501f22381e8497e561d2cca8dfcaed3d79ed5f9c2e88375'
AND (
token = '4alFTQ6R3nzHlll8cBRgUEgICizSDVdCyjLYinghuio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)