UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fGxeSodGvcY0GVymqXOTHNwm7Ft+oiUodD2BunK9MTc=' 
WHERE 
  key_id = '6ae314d5b4fb630884909b75e9b9b011d0df355e0575ac4f97352ff28b550c85' 
  AND (
    token = 'fGxeSodGvcY0GVymqXOTHNwm7Ft+oiUodD2BunK9MTc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027