UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+TGVIy2H0/I+HcE9GXOf24SaIEMi0M13rB8cVYfSmwc='
WHERE
key_id = 'c335e25b99b5fa3121b2d68018c66d84eaf01cc62aead92f14616ced903f167d'
AND (
token = '+TGVIy2H0/I+HcE9GXOf24SaIEMi0M13rB8cVYfSmwc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)