UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OjtRYtfxK0S+TTCLDSNGyhVRwB/FS5GRWpqY++QvHYw='
WHERE
key_id = 'b628ffcca7f29fc4dc9c2f2301c4bf37d4fa672a76ea6663df5b2bf26435d2cc'
AND (
token = 'OjtRYtfxK0S+TTCLDSNGyhVRwB/FS5GRWpqY++QvHYw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)