UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vqwvkT3dbNYPwGT0MdMd4DmSpX3IStodxOeORPf3QR4='
WHERE
key_id = '63dd88372455536cb24ca0ebf7dec6ae4985d099b60b821223ee072352d03195'
AND (
token = 'vqwvkT3dbNYPwGT0MdMd4DmSpX3IStodxOeORPf3QR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)