UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c67vw2b+hxqJ/cSU/C9aq8VUIT6nh5IgH65sFUlD0A4='
WHERE
key_id = '527e8127e841f9f8f833ee0ec22aad62a65681ccbbdb4b18b8355eac9ab8c776'
AND (
token = 'c67vw2b+hxqJ/cSU/C9aq8VUIT6nh5IgH65sFUlD0A4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)